package com.example.mapper;

import com.example.domain.dto.DepartmentDTO;
import com.example.domain.po.Department;
import com.example.domain.vo.CourseVo;
import com.example.domain.vo.DepartmentVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface DepartmentMapper {

    List<Department> list();

    @Select("select * from department where id=#{id}")
    Department findById(Integer id);

    List<Department> findByHospitalId(Integer id);

    List<DepartmentVo> page(@Param("name") String name, @Param("hospitalId") Integer hospitalId);


    @Insert("insert into department(name) values (#{name})")
    void add(DepartmentDTO departmentDTO);

    @Update("update department set name =#{name} where id=#{id}")
    void update(DepartmentDTO departmentDTO);



    List<Department> singleList( String name);

    @Delete("delete from department where id=#{id};")
    void del(Integer id);
}
